//
//  KYMatchDoctorTableViewCell.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/16.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYMatchDoctorTableViewCell.h"
#import <SDWebImage/UIImageView+WebCache.h>

@interface KYMatchDoctorTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *headImg;
@property (weak, nonatomic) IBOutlet UILabel *nameLbale;
@property (weak, nonatomic) IBOutlet UILabel *positionLabel;
@property (weak, nonatomic) IBOutlet UILabel *hospitalLabel;
@property (weak, nonatomic) IBOutlet UIImageView *image1;
@property (weak, nonatomic) IBOutlet UILabel *label1;
@property (weak, nonatomic) IBOutlet UIImageView *image2;
@property (weak, nonatomic) IBOutlet UILabel *label2;
@property (weak, nonatomic) IBOutlet UIImageView *image3;
@property (weak, nonatomic) IBOutlet UILabel *label3;
@property (weak, nonatomic) IBOutlet UIImageView *matchImage;
@property (weak, nonatomic) IBOutlet UILabel *matchLabel;



@end

@implementation KYMatchDoctorTableViewCell
+(instancetype)getCell{
    return [[[NSBundle mainBundle]loadNibNamed:@"KYMatchDoctorCell" owner:nil options:0]lastObject];
}
- (void)awakeFromNib {
    // Initialization code
    self.headImg.layer.cornerRadius = self.headImg.frame.size.width/2;
    self.headImg.layer.masksToBounds = YES;
}
-(void)setModel:(KYMatchDorctorModel *)model{
    _model = model;
    
    //self.headImg.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:model.doctor_portrait]]];
    NSURL *url = [NSURL URLWithString:model.doctor_portrait];
    [self.headImg sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"1"]];
    self.nameLbale.text = model.doctor_name;
    self.positionLabel.text = model.doctor_title_name;
    self.hospitalLabel.text = model.doctor_hospital_name;
    self.label1.text = [NSString stringWithFormat:@"%zd",model.operation_count];
    self.label2.text = [NSString stringWithFormat:@"%zd",model.flower];
    self.label3.text = [NSString stringWithFormat:@"%zd",model.banner];
    self.matchLabel.text = model.accuracy;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
